Skip to content

Conversation

vesper8
Copy link
Contributor

@vesper8 vesper8 commented Apr 1, 2019

example usage:

        $menu = (new CliMenuBuilder)
        ->addItem('Print A', function () { echo 'A'; })
        ->build();

        $menu->disableDefaultControlMappings();

        $menu->open();
        $menu = (new CliMenuBuilder)
        ->addItem('Print A', function () { echo 'A'; })
        ->build();

        $defaultControlMappings = [
            'a' => InputCharacter::LEFT,
            's' => InputCharacter::DOWN,
            'w' => InputCharacter::UP,
            'd' => InputCharacter::RIGHT,
        ];

        $menu->setDefaultControlMappings($defaultControlMappings);

        $menu->open();

adds a method for setting default control mappings
@Lynesth
Copy link
Collaborator

Lynesth commented Apr 1, 2019

To be honest I don't really care about the VIM mapping and even think we could simply remove those by defaults.

@mikeymike
Copy link
Member

@Lynesth removal at this point would be a BC, maybe something we can consider when we're closer to another major version ?

@AydinHassan AydinHassan merged commit 33ac5c0 into php-school:master Apr 1, 2019
@AydinHassan
Copy link
Member

AydinHassan commented Apr 1, 2019

Thanks @vesper8 ! docs would be appreciated 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants